import request from "./request";
import mockRequest from './mockRequest'

// 首页三级分类
export const reqCategoryList = () => request.get('product/getBaseCategoryList')

// banner 首页轮播图
export const reqBannerList = ()=> mockRequest.get('/banner')

// 获取floor数据
export const reqFloorList = ()=>mockRequest.get('/floor')

// 获取搜索模块信息
export const reqSearchInfo = (params)=>request({url:'/list',method:'post',data:params})

// 获取商品详情信息
export const reqGoodsInfo = (skuId)=>request.get(`/item/${skuId}`)

// 添加到购物车
export const reqAddOrUpdateCart = (skuId,skuNum)=>request({url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'})

// 获取购物车数据
export const reqCartList = ()=> request.get('/cart/cartList')

//删除某一个商品的接口
export const reqDeleteCartShop = (skuId)=>request({url:`/cart/deleteCart/${skuId}`,method:'delete'})

// 修改购物车商品的选中状态
export const reqShopChecked=(skuId,isChecked)=>request.get(`/cart/checkCart/${skuId}/${isChecked}`);

//获取验证码接口
export const reqGetCode = (phone)=>request.get(`/user/passport/sendCode/${phone}`);

//注册接口
export const reqRegist = (data)=>request({url:`/user/passport/register`,method:'post',data});

//登录接口:请求体携带参数 phone&&password
export const reqLogin = (data)=>request({url:`/user/passport/login`,method:'post',data});

//获取用户登录成功以后用户信息的接口
export const reqUserInfo = ()=>request.get(`/user/passport/auth/getUserInfo`);

//退出登录业务
export const reqLogout = ()=>request.get(`/user/passport/logout`);

//获取用户地址信息
export const reqAddressInfo = ()=>request.get(`/user/userAddress/auth/findUserAddressList`);

//获取商品清单数据
export const reqShopInfo = ()=>request.get(`/order/auth/trade`);

//提交订单接口
export const reqSubmitOrder = (tradeNo,data)=>request({url:`/order/auth/submitOrder?tradeNo=${tradeNo}`,method:'post',data});

//获取支付信息接口
export const reqPayInfo = (orderId)=>request.get(`/payment/weixin/createNative/${orderId}`);

//查询支付结果
export const reqPayResult = (orderId)=>request.get(`/payment/weixin/queryPayStatus/${orderId}`);


//获取我的订单
export const reqMyOrderList = (page,limit)=>request.get(`/order/auth/${page}/${limit}`);